from fastapi import APIRouter
from src.edit_file.datamodel import AiEditModel

from src.edit_file.tasks import run_edit_task
from src.huey_init.storages import Storage


router = APIRouter(
    prefix="/revise",
    tags=["revise"],
    responses={404: {"description": "Not found"}}
)
# 修订任务入口
@router.post("/revise")
async def aitemplate(edit_model: AiEditModel):
    res = run_edit_task(edit_model)
    return {"status": "success", "aitask_id": res.id}